﻿@using X.PagedList;
@using X.PagedList.Mvc.Core;
@using X.PagedList.Mvc.Common;
@using FwProject.PrePaymentInfo.Dto
@model SummaryDailyIncomeAndExpensesDto
@{
    Layout = null;
    int i = 0;
    if (Model.pagelist.Count > 0)
    {
        if (Model.pagelist.PageNumber != 1)
        {
            i = (Model.pagelist.PageNumber - 1) * Model.pagelist.PageSize;
        }
    }
}
<div id="table_print" style="max-height:600px;overflow-y:scroll;">
    <table class="table table-bordered table-hover table-rowselected" style="width:50%">
        <thead>
            <tr>
                <th style="width:45px">序号</th>
                <th>日期</th>
                <th>本日收入</th>
                <th>本日支出</th>
                <th>收支差额</th>
            </tr>
        </thead>
        <tbody>
            @if (Model.pagelist.Count == 0)
            {
                <tr><td colspan="5" align="center">暂无数据</td></tr>
            }
            else
            {
                foreach (var item in Model.pagelist)
                {
                    i++;
                    <tr>
                        <td>@i</td>
                        <td>@item.Date.ToString("yyyy-MM-dd")</td>
                        <td>@item.Income</td>
                        <td>@item.Expenses</td>
                        <td>@item.Difference</td>
                    </tr>
                }
                <tr class="footer" style="color:red">
                    <td>合计</td>
                    <td></td>
                    <td>@Model.SumIncome</td>
                    <td>@Model.SumExpenses</td>
                    <td>@Model.SumDifference</td>
                </tr>
            }
        </tbody>
    </table>
</div>
<div class="row pagedinfo">
    <div class="col-sm-5">
        共 @Model.pagelist.TotalItemCount 条，
        <select class="form-control" id="pageSize" style="width:70px;display:initial">
            @for (int z = 10; z < 100; z = z + 10)
            {
                if (z == Model.pagelist.PageSize)
                {
                    <option selected value="@z">@z</option>
                }
                else
                {
                    <option value="@z">@z</option>
                }
            }
        </select> &nbsp; 条/页 当前第 @Model.pagelist.PageNumber/@Model.pagelist.PageCount 页
    </div>
    <div class="col-sm-7">
        <input type="hidden" id="pageurl" value="&beginTime=@(Context.Request.Query["beginTime"])&endTime=@(Context.Request.Query["endTime"])" />
        @Html.PagedListPager(Model.pagelist, page => Url.Action("DailyIncomeAndExpenses", new { pageIdx = page, size = Context.Request.Query["size"], beginTime = Context.Request.Query["beginTime"], endTime = Context.Request.Query["endTime"] }), PagedListRenderOptions.EnableUnobtrusiveAjaxReplacing(new AjaxOptions() { AllowCache = false, HttpMethod = "Get", UpdateTargetId = "data_list", OnSuccess = "AjaxSuccessCallback", OnBegin = "AjaxBegin" }))
    </div>
</div>




